/**
 * Created by Toma on 2016/5/31
 */

/**
 * 根据频幕改变页面尺寸
 * @param size 基础大小
 */
(function (size) {
  var docEl = document.documentElement,
    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
    recalc = function() {
      docEl.style.fontSize = 20*(docEl.clientWidth/size)+'px';
    };
  window.addEventListener(resizeEvt, recalc, false);
  document.addEventListener('DOMContentLoaded', recalc, false);
})(375);

/**
 * 单选框
 */
var radiobox = function () {
  $('.radiobox').on('tap',function(){
    var _this = $(this),
        value = _this.attr('data-val');
    _this.addClass('action').siblings().removeClass('action');
    _this.parent().find('.radio-val').val(value);
  });
};